#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>

@interface MuseekMessage : NSObject {
	long pos;
	NSMutableData *data;
	uint32_t code;
}
@property (readonly) NSNumber* code;
@property (assign) NSMutableData *data;
@property (readonly) void *bytes;
@property (readonly) long length;
@property long pos;

+(MuseekMessage *) messageWithData:(NSArray *)data order:(NSString *)order;
-(MuseekMessage *) appendByte: (uint8_t) value; 
-(MuseekMessage *) appendUInt32: (uint32_t) value; // append an int32 value on data, using the SoulSeek byte ordering.
-(MuseekMessage *) appendUInt64: (uint64_t) value;
-(MuseekMessage *) appendString: (NSString *) value; 
-(MuseekMessage *) appendData: (NSData *) value;

-(uint64_t) readUInt64;
-(uint32_t) readUInt32;
-(uint8_t) readByte;
-(NSString *) readString;

-(id) init;
@end